//
// Created by ashCheng on 2022/8/31.
//
#include "iostream"

int main()
{
  int currentVal= 0, var = 0;
  if (std::cin >> currentVal) {
    int cnt = 1;
    while (std::cin >> var) {
      if (currentVal == var) {
        ++cnt;
      }else {
        std::cout << currentVal << " occurs " << cnt << " times" << std::endl;
        currentVal = var;
        cnt = 1;
      }
    }
    std::cout << currentVal << " occurs " << cnt << " times" << std::endl;
  }
  return 0;
}